package com.bcpapp.project.controller;


import com.bcpapp.project.constant.RLConstant;
import com.bcpapp.project.service.ReLiService;
import com.bcpapp.project.task.TaskServer;
import com.bcpapp.project.utils.TimeUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/troom")
public class TRoomController {


    @Autowired
    private ReLiService reLiService;

    @Autowired
    private TaskServer taskServer;



    @GetMapping("/task1")
    public void  task1() {
        taskServer.rlQHTask();
    }

    @GetMapping("/task2")
    public void  task2() {
        taskServer.rlQYTask();
    }


    @GetMapping("/getTroom")
    public void  getTroom() {
        String lastDateStr = TimeUtils.getLastDateStr();
        /*
         * 区划迁入迁出驻留分析接口
         * */
        reLiService.populationsituationday(lastDateStr);
    }
    @GetMapping("/getTroom1")
    public void  getTroom1() {
        Integer[] twoHour = TimeUtils.getTwoHour();
        reLiService.flowsum("4136727468333852615",twoHour[0],twoHour[1]);
        ///reLiService.flowsum("4136727468333852615",1700002800,1700035200);
    }

    @GetMapping("/getTroom2")
    public void  getTroom2() {
        Integer[] twoHour = TimeUtils.getTwoHour();
        reLiService.population("4136727468333852615",twoHour[0],twoHour[1]);
        ///reLiService.flowsum("4136727468333852615",1700002800,1700035200);
    }

    @GetMapping("/getTroom3")
    public void  getTroom3() {
        reLiService.predictpopulation("4136727468333852615");
        ///reLiService.flowsum("4136727468333852615",1700002800,1700035200);
    }

    @GetMapping("/getTroom4")
    public void  getTroom4() {
        Integer[] twoHour = TimeUtils.getTwoHour();
        reLiService.locationpoint("4136727468333852615",twoHour[0],twoHour[1]);
        ///reLiService.flowsum("4136727468333852615",1700002800,1700035200);
    }

    @GetMapping("/getTroom5")
    public void  getTroom5() {
        Integer[] twoHour = TimeUtils.getTwoHour();
        reLiService.flow("4136727468333852615",twoHour[0],twoHour[1]);
        ///reLiService.flowsum("4136727468333852615",1700002800,1700035200);
    }

    @GetMapping("/getTroom6")
    public void  getTroom6() {
        String lastDateStr = TimeUtils.getLastDateStr();
        reLiService.adcodemigration(lastDateStr);
        ///reLiService.flowsum("4136727468333852615",1700002800,1700035200);
    }

    @GetMapping("/getTroom7")
    public void  getTroom7() {

        //reLiService.migrationuserprofile(lastDateStr);
        ///reLiService.flowsum("4136727468333852615",1700002800,1700035200);
    }

    @GetMapping("/getTroom8")
    public void  getTroom8() {

        Integer[] twoHour = TimeUtils.getTwoHour();
        reLiService.userprofile("4136727468333852615",twoHour[0],twoHour[1]);
        //reLiService.userprofile("4136727468333852615",1700002800,1700035200);
    }
}
